<meta charset="UTF-8">
<nav class="navbar navbar-default gloal_menu">
	<div id="ugl_password" class="panel-passowrd">
		<div class="panel-heading panel-result-title">
			<h3 class="panel-title">修改密码</h3>
		</div>
			<form class="form-horizontal" name="form" action="yueyogaAdmin/updatePassword.jhtml" method="post">
				<div>
				<br>
					<label for="inputOldPassword" class="col-sm-3 control-label" style="width: 80px;">旧密码</label>
					<div class="col-sm-9" style="width: 300px;">
						<input type="password" class="form-control" name="originalpwd" value="${oldpwd}" required id="inputOldPassword" >
					</div>
					<br><br>
					<label for="inputNewPassword" class="col-sm-3 control-label" style="width: 80px;">新密码</label>
					<div class="col-sm-9" style="width: 300px;">
						<input type="password" class="form-control" name="newpassword" value="${newpwd}" required id="inputNewPassword" >
					</div>
					<br><br>
					<label for="inputAgainPassword" class="col-sm-3 control-label" style="width: 80px;">新密码</label>
					<div class="col-sm-9" style="width: 300px;">
						<input type="password" class="form-control" name="confirmpwd" value="${againpwd}" required id="inputAgainPassword">
					</div>
					<br><br>
					<div class="col-sm-offset-2" style="margin: 10px 44px 0 30px; float: right;">
						<button onclick="update()" type="button" class="btn btn-default">修改</button>
						<button onclick="hide_btn()" type="button" class="btn btn-default">取消</button>
					</div>
				</div>
			</form>
		</div>
	<div class="collapse navbar-collapse menu_all">
		<ul id="ul_top_con" class="nav navbar-nav">
			<li id="li_main"><a href="yueyogaAdmin/main.jhtml"><span class="glyphicon glyphicon-home"></span>&nbsp;&nbsp;主页 </a></li>
			<li id="li_search" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;搜索<b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="yueyogaAdmin/searchMember.jhtml"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;会员</a></li>

					<li><a href="yueyogaAdmin/searchClass.jhtml"><span class="glyphicon glyphicon-indent-left"></span>&nbsp;&nbsp;班级</a></li>

					<li><a href="yueyogaAdmin/searchLiftClubs.jhtml"><span class="glyphicon glyphicon-certificate"></span>&nbsp;&nbsp;活动</a></li>

					<li><a href="yueyogaAdmin/searchProducts.jhtml"><span class="glyphicon glyphicon-euro"></span>&nbsp;&nbsp;产品</a></li>

					<li><a href="yueyogaAdmin/searchGoods.jhtml"><span class="glyphicon glyphicon-glass"></span>&nbsp;&nbsp;商品</a></li>

					<li><a href="yueyogaAdmin/searchTasks.jhtml"><span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;任务</a></li>

					<li><a href="yueyogaAdmin/searchRecharge.jhtml"><span class="glyphicon glyphicon-usd"></span>&nbsp;&nbsp;收入</a></li>
					<li id="li_qtdz"><a href="yueyogaAdmin/seat.jhtml"><span class="glyphicon glyphicon-dashboard"></span>&nbsp;&nbsp;前台订座</a></li>
				</ul></li>

			<li id="li_add" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;创建<b class="caret"></b> </a>
				<ul class="dropdown-menu">
					<li><a href="yueyogaAdmin/toAddMember.jhtml"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;会员</a></li>

					<li><a href="yueyogaAdmin/toAddClass.jhtml"><span class="glyphicon glyphicon-indent-left"></span>&nbsp;&nbsp;班级</a></li>

					<li><a href="yueyogaAdmin/toAddLiftClubs.jhtml"><span class="glyphicon glyphicon-certificate"></span>&nbsp;&nbsp;活动</a></li>

					<li><a href="yueyogaAdmin/toAddProduct.jhtml"><span class="glyphicon glyphicon-euro"></span>&nbsp;&nbsp;产品</a></li>

					<li><a href="yueyogaAdmin/toAddGoods.jhtml"><span class="glyphicon glyphicon-glass"></span>&nbsp;&nbsp;商品</a></li>

					<li><a href="yueyogaAdmin/toAddTask.jhtml"><span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;任务</a></li>
					
					<li><a href="yueyogaAdmin/consumption.jhtml"><span class="glyphicon glyphicon-usd"></span>&nbsp;&nbsp;消费</a></li>
				</ul></li>
			
			
			<!-- 数据统计 -->
			<li id="li_tj" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-stats"></span>&nbsp;&nbsp;统计<b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="yueyogaAdmin/toMemberStatistics.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;通用统计</a></li>
					<li><a href="yueyogaAdmin/toExpression.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;高级查询</a></li>
					<li><a href="yueyogaAdmin/toKeeperRecordQuery.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;会籍顾问工作记录</a></li>
					<li><a href="yueyogaAdmin/cardreports.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;卡种销售组成分析</a></li>
					<li><a href="yueyogaAdmin/monthReports.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;销售工作月报</a></li>
					<li><a href="yueyogaAdmin/findCash.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;收银日报表</a></li>
					<li><a href="yueyogaAdmin/findChargerReport.jhtml"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;负责人销售业绩</a></li>
				</ul>
			</li>
			
			<!-- 系统设置相关 -->
			<li id="li_system" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cog"></span>&nbsp;&nbsp;系统<b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="yueyogaAdmin/toSystem.jhtml"><span class="glyphicon glyphicon-list"></span>&nbsp;&nbsp;系统设置</a></li>
					<li><a href="yueyogaAdmin/searchBasicUsers.jhtml"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;用户设置</a></li>
					<li><a href="yueyogaAdmin/findCoachList.jhtml"><span class="glyphicon glyphicon-glass"></span>&nbsp;&nbsp;基础数据</a></li>
					<li><a href="yueyogaAdmin/toHallList.jhtml"><span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;瑜伽分馆</a></li>
				</ul>
			</li>
		</ul>
		
		<ul class="nav navbar-nav" style="margin-left:650px;">
			<li><a href="#" class="dropdown-toggle" data-toggle="dropdown">切换会馆<b class="caret"></b></a>
			<ul class="dropdown-menu ul_login_user">
					<!-- #set(Hall hal) -->
					<li><a href="yueyogaAdmin/main.jhtml?hallcode=${hal.code}">${hal.name}</a></li>
					<!-- #for(UserHallModel mod : userHall) -->
					<!-- #if(hal.name!=mod.hname) -->
					<li><a href="yueyogaAdmin/main.jhtml?hallcode=${mod.hallcode}">${mod.hname}</a></li>
					<!-- #end -->
					<!-- #end -->
				</ul>
			</li>
		</ul>
		<ul class="nav navbar-nav navbar-right">
			<!-- #set(UserDetail sessionUserInfo) -->
			<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">${sessionUserInfo.name}<b class="caret"></b></a>
				<ul class="dropdown-menu ul_login_user">
					<li><a href="yueyogaAdmin/toUpdateUser.jhtml">修改信息</a></li>
					<li onclick="updatePassword()"><a href="javascript:void(0)">修改密码</a></li>
					<li><a href="yueyogaAdmin/j_spring_security_logout">注销登录</a></li>
				</ul></li>
		</ul>
	</div>
</nav>
<div id="search_extends"><a href="javascript:void(0)" onclick="showOrHide()">&nbsp;>>&nbsp;</a></div>
<script type="text/javascript">
	function update() {
		$("#ugl_password").css("display", "none");
		var oldPwd = $("#inputOldPassword").val();
		var pwd = $("#inputNewPassword").val();
		var againPwd = $("#inputAgainPassword").val();
		if (pwd != againPwd) {
			confirm("两次输入密码不一致!", function() {
				this.close();
				$("#ugl_password").css("display", "block");
			});
		} else if (pwd.length<6||pwd.length>15) {
			confirm("密码长度介于6-15位之间", function() {
				this.close();
				$("#ugl_password").css("display", "block");
			});
		} else {
			var url = "yueyogaAdmin/updatePassword.jhtml";
			$.post(url, {
				"oldPwd" : oldPwd,
				"pwd" : pwd
			}, function(msg) {
				if (msg == "error") {
					confirm("旧密码输入错误!", function() {
						this.close();
						$("#ugl_password").css("display", "block");
					});
				} else {
					if (msg == "success") {
						var d = alert("修改密码成功");
						setTimeout(function() {
							d.close().remove();
						}, 300);
						location.replace(location);
					} else {
						alert("密码修改失败!");
						return;
					}
				}
			});
		}
	}
	function updatePassword() {
		$("#ugl_password").show();
	}
	function hide_btn() {
		$("#ugl_password").hide();
	}
	function showOrHide(){
		var hidden = $(".panel-db-cdt").is(":hidden");
		var val = ">>";
		if(!hidden){
			val = "<<";
		}
		$("#search_extends a").text(val);
		$(".panel-db-cdt").slideToggle("normal");
	}
$(function(){
	var result = $("#li_search").hasClass("active");
	if(result){
		$("#search_extends").show();
	}
});
</script>